home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MACD 5
/
MACD 5.bin
/
internet
/
yam_i_dodatki
/
yamscripts
/
georeply.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1997-07-22
|
1KB
|
60 lines
/* Skips the HTML part of a message and replies to the second part.
**
*/
options results
tmp='t:letter.tmp'
quote='> '
wrap=76
address 'YAM'
'GetMailInfo file'
if rc>0 then do
'Request "Select a message first!" "_Ok"'
exit
end
else
file=result
if open(in,file,'r') & open(out,tmp,'w') then do
BeenThereDoneThat=0
do until r='' | eof(in)
r=readln(in)
if word(r,1)='Content-Type:' & ~BeenThereDoneThat then do
r=translate(r,' ','"')
boundary=word(r,words(r))
BeenThereDoneThat=1
end /* if word */
end /* do until */
BoundaryCounter=0
do until eof(in) | (BoundaryCounter=2 & r='')
r=strip(readln(in))
if pos(boundary,r)>0 then BoundaryCounter=BoundaryCounter+1
end /* do until */
do until eof(in) | r=boundary
r=readln(in)
if pos(boundary,r)=0 & ~eof(in) then call QuoteLine(r)
end /*do until */
call close(in)
call close(out)
end /* if open */
else do
'Request "Can not copy letter!" "_Ok"'
exit
end
'MailReply'
'WriteLetter "'tmp'"'
exit
QuoteLine:
parse arg str
if length(quote || str) > wrap then do
p=lastpos(' ',str,wrap - length(quote))
if p=0 then p=wrap - length(quote)
call writeln(out,quote || left(str,p))
call QuoteLine(substr(str,p+1))
end
else
call writeln(out,quote || str)
return